Rewrites axiom at given depth using rewrite rules defined with defsym. Use it to generate melodies, chords, rhythms and velocities. See also gen-lsystem, transform-lsystem and filter-preserve.
(initdef)
(defsym g '(g f x < + g > < - g >))
(defsym x '(x < - f f f > < + f f f > f x))
(defsym - '-)
(defsym + '+)
(defsym < '<)
(defsym > '>)
(gen-rewrite g 2)
--> (g f x < + g > < - g > x < - f f f > < + f f f > f x < + g
f x < + g > < - g > > < - g f x < + g > < - g > >)
(initdef 'mater2)
(defsym g '(g f x < + g > < - g >) :tree 'mater2)
(defsym x '(x < - f f f > < + f f f > f x) :tree 'mater2)
(defsym - '- :tree 'mater2)
(defsym + '+ :tree 'mater2)
(defsym < '< :tree 'mater2)
(defsym > '> :tree 'mater2)
(gen-rewrite g 2 'mater2)
--> (g f x < + g > < - g > x < - f f f > < + f f f > f x < +
g f x < + g > < - g > > < - g f x < + g > < - g > >)